package ebcs.database.service;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import ebcs.database.bean.BsGoal;
import ebcs.database.bean.BsNeedInfor;
import ebcs.database.bean.BsNeedInforData;
import ebcs.database.bean.BsNeedStage;
import ebcs.database.bean.BsNeedTime;
import ebcs.database.bean.BsOnlineNeed;
import ebcs.database.bean.BsSaleNeed;
import ebcs.database.bean.BsUserInfor;
import ebcs.database.bean.BsUserNeedRel;
import ebcs.database.bean.FaceToFace;
import ebcs.database.bean.NeedConversion;
import ebcs.database.bean.RpUserReportBean;
import ebcs.database.bean.RpUserTaskNeedBean;
public interface BsUserNeedServiceImp
{ 
 	//保存登记信息
	public boolean regUserNeedRel(BsUserNeedRel userNeed);
	//查询用户报工情况
	public List<RpUserReportBean> searchUserNeedInfor(RpUserReportBean reportConditon);
	public List<RpUserReportBean> searchUserNeedInforPage(RpUserReportBean reportConditon);
	int searchUserNeedInforPageCount(RpUserReportBean reportConditon);
 	//查询用户历史报工数据
	public List<RpUserReportBean> searchUserHistoryNeedInfor(RpUserReportBean reportConditon);
	//查询用户历史报工数据
	public List<RpUserReportBean> selectHistoryNeedInfor(RpUserReportBean reportConditon);
	//需求进度实时统计
	public List<RpUserReportBean> selectReportCount(RpUserReportBean reportConditon);
 
	//查询用户正在处理任务单
	public List<RpUserTaskNeedBean> selectTaskNeedList(RpUserTaskNeedBean condition);
	
	//查询用户没有处理任务单
	public List<RpUserTaskNeedBean> selectNoTaskNeedList(RpUserTaskNeedBean condition);
	//查询用户报工所有时间长
	public int selectUserTaskTime(RpUserTaskNeedBean condition);
	//删除报工信息
    public int deleteUserNeedInfor(String rouid);
    //新增需求
    public int addNeedInfor(BsNeedInfor record);
    //查询项目组中需求编号和项目组信息
    public List<BsNeedInfor>  selectNeedInforByNeedNoAndTeamNo(BsNeedInfor record);
    //查询领取其他项目组任务功能
    public List<RpUserTaskNeedBean> selectTaskNeedListByTeamNo(RpUserTaskNeedBean condition);
    //查询团队所有项目组任务
	public List<RpUserTaskNeedBean> selectTaskNeedListByGroupNo(RpUserTaskNeedBean condition);
	//更新需求信息
	public int updateNeedInforById(BsNeedInfor need);
	//更新已报工的需求编号
	public int updateNeedNoRelByNeedId(BsNeedInfor bean);
	
	//查询项目组下所有需求
	public List<BsNeedInfor> selectNeedInforList(BsNeedInfor need);
	public List<BsNeedInfor> selectNeedInfor(BsNeedInfor need);
	public List<BsNeedInfor> selectNeedInforDetail(BsNeedInfor need);
	public int selectNeedInforDetailPageCount(BsNeedInfor req);
	public List<BsNeedInfor> selectNeedInforDetailPage(BsNeedInfor req);
	//查下报工时间轴信息
	
	public List<BsNeedTime> selectNeedTimeList(BsUserInfor user);

    //修改最新的一条报工记录为关闭任务
	public int closeUserNeedRel(String rouid);
	public int reStartUserNeedRel(String rouid);
	//根据团队编号查询所有未通过审核的需求
    List<BsNeedInfor> selectNoPassNeedByRouid(String rouid);
    //根据rouid更新state字段
    int updateStateByRouid(@Param("rouid") String rouid,@Param("state") String state);
  //根据rouid更新sign字段
    int updateSignByRouid(@Param("rouid") String rouid,@Param("sign") String sign);
    
    List<BsNeedInforData> selectByBsNeedInforData(@Param("record")BsNeedInforData bsNeedInforData);
    int insertNeedInforData(List<BsNeedInforData> list);
    int updateNeedInforDataByNeedNo(BsNeedInforData bsNeedInforData);
    //清空表记录  再把最新抓取的数据填入
    int deleteNeedInforData();
	public BsUserInfor getProTeamNo(String userNo);
	public void updateNeedInfor(BsNeedInfor needInfor);
	public boolean deleteInfor(String needId);
	public List<BsUserNeedRel> selectByNeedId(String needId);
	// 项目经理审核报工
	public List<RpUserReportBean> searchReviewJob(RpUserReportBean reportConditon);
	//更新审核状态
	public void updateReportStateByRouId(BsUserNeedRel bsUserNeedRel);
	//报工历史查询
	public List<RpUserReportBean> searchHistoryJob(RpUserReportBean req);

//监控表银行分解
	public List<BsNeedInfor> selectBankResolve(BsNeedInfor req);
	public List<BsNeedInfor> selectBankResolvePage(BsNeedInfor req);
	public int doUpdateJianKong(BsNeedInfor req);
      //监控表银行汇总
	List<BsNeedInfor> selectBankSummary();
	//监控表软件部汇总
	public List<BsNeedInfor> selectSoftwareSummary(BsNeedInfor req);
		//监控银行分页总数
	public int selectBankResolvePageCount(BsNeedInfor req);
	// 查询经理team下的所有needInfor
	public List<BsNeedInfor> searchNeedInforList(BsNeedInfor needInfor);


	public void updataProstate(String rouid); 
	public void updatahandProstate(String rouid);  
	public List<BsUserNeedRel> getUserneedGroup(String rouid); 
	public List<BsUserNeedRel> getAllneedGroup(String rouid);
	public List<BsUserNeedRel> getPaname(String paraid);
	public List<BsUserNeedRel> selectUserRemark(String rouid);  

	// 团队经理审核项目经理
	public List<RpUserReportBean> searchTeamReviewJob(RpUserReportBean record);
	// 查询团队下所有项目经理未审核和审核未通过的需求信息
	public List<BsNeedInfor> searchTeamNeedInforList(BsNeedInfor needInfor);
    
	//录入销售系统(查询)
	public List<BsSaleNeed> selectBsSaleNeedById(String needid);
	
	//新增销售系统录入
	int insertSaleNeed(BsSaleNeed req);
	
	//删除销售系统
	int deleteSaleNeed(String rouid);
	
	//上线数据(查询)
	List<BsOnlineNeed> selectBsOnlineNeedById(String needid);
	//新增上线数据
	int insertBsOnlineNeed(BsOnlineNeed req);
	//删除上线数据
	int deleteBsOnlineNeed(String rouid);
	

	//根据userNo查询proGroupNo yf 2018.10.11
	public String selectProGroupNoByUserNo(String userNo);

	
	
	//端对端
	
List<FaceToFace>selectFace(FaceToFace req);
	
	List<FaceToFace>selectFacePage(FaceToFace req);
	
	int selectFaceCount(FaceToFace req);

	//查询各团队实际和目标营收
	public List<BsNeedInfor> selectGoalAndReality(BsNeedInfor req);
	//查询团队中各项目组的收入
	public List<BsNeedInfor> selectAllTeamIncome(BsNeedInfor req);
	
	//查询总团队实际和目标营收
		public List<BsNeedInfor> selectGoalAndGroup();
		//查询各团队的收入
		public List<BsNeedInfor> selectAllGroupIncome();
	//查询当月项目组的实际和目标营收
	public List<BsNeedInfor> selectCurMonthList(BsNeedInfor req);
	//查询项目组的实际和目标营收
	public List<BsNeedInfor> selectGoalAndRealityTeam(BsNeedInfor req);
	
	//需求过程
	int insertBsNeedStage(BsNeedStage req);
	List<BsNeedStage> selectBsNeedStage(BsNeedStage req);
	int updateBsNeedStage(BsNeedStage req);
	int updateBsNeedStageOld(BsNeedStage req);
	int updateBsNeedStageNew(BsNeedStage req);
	int insertHisStage(BsNeedStage req);
	
	//目标
	int insertteamgoal(BsGoal req);
	int insertgoal(BsGoal req);
	List<BsGoal> selectteamgoal(BsGoal req);
	List<BsGoal> selectgoal(BsGoal req);
	int updategoal(BsGoal req);
	List<BsGoal> selectteamgoalsum(BsGoal req);
	int deleteteamgoal(String rouid);

	//转化率报表
		List<NeedConversion> selectNeedConversion(NeedConversion req);
	List<NeedConversion> selectConversion();
}
